<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="assets/css/bootstrap.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="assets/css/ace.min.css"/>
    <link rel="stylesheet" href="css/style.css"/>
    <title>权限用户</title>
</head>

<body>
<div class="page-content">
    <div class="user_Manager_style">
        <div class=" Manager_style">
            <span class="title_name" th:text="${menu.menuName}">使用范围</span>
            <h4><span style="color: blue" th:text="${directory.directoryName}">第一章 总则</span></h4>

            <div class="add_user_style clearfix">
                <div class="xinxi-xs clearfix">
                    <label class="label_name lf" style="color: blue" th:text="${clause.clauseId}">第21.2条</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                    <span th:if="${flag}"><a style="display: none" href="javascript:void(0)"
                                             th:onclick="'add('+${directory.id}+','+${clause.id}+','+${lawsId}+')'"
                                             id="shoucang">收藏</a>
                        <a href="javascript:void(0)"
                           th:onclick="'del('+${directory.id}+','+${clause.id}+','+${lawsId}+')'"
                           id="quxiao">已收藏</a></span>


                    <span th:if="${!flag}"><a href="javascript:void(0)"
                                              th:onclick="'add('+${directory.id}+','+${clause.id}+','+${lawsId}+')'"
                                              id="shoucang">收藏</a>
                        <a style="display: none" href="javascript:void(0)"
                           th:onclick="'del('+${directory.id}+','+${clause.id}+','+${lawsId}+')'"
                           id="quxiao">已收藏</a></span>

                </div>
                <ul>
                    <span><label class="label_name" th:text="${clause.clauseContent}"></label> </span>
                </ul>

                <!--<button
                        th:onclick="|add( '${directory.id}','${clause.id}','${lawsId}')|">收藏</button>-->
            </div>
            <div class="">
                <button id="submit" type="button" class="btn btn-primary" >立即咨询</button>
            </div>
        </div>
    </div>
</div>
<script src="assets/js/jquery.min.js"></script>
<!-- <![endif]-->
<!--[if IE]>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<![endif]-->
<!--[if !IE]> -->
<!-- <![endif]-->

<!--[if IE]>
<script type="text/javascript">
    window.jQuery || document.write("<script src='assets/js/jquery-1.10.2.min.js'>" + "<" + "/script>");
</script>
<![endif]-->
<script src="assets/js/bootstrap.min.js"></script>
<script>
    function add(directoryId, clauseId, lawsId) {

        $.getJSON("/addConllection", {currentId: directoryId, clauseId: clauseId, lawsId: lawsId}, function (opj) {
            if (opj) {
                $("#shoucang").hide();
                $("#quxiao").show();
            }
        })
    }


    function del(directoryId, clauseId, lawsId) {
        $.getJSON("/deleteConllection", {currentId: directoryId, clauseId: clauseId, lawsId: lawsId}, function (opj) {
            if (opj) {
                $("#shoucang").show();
                $("#quxiao").hide();
            }
        })
    }
$("#submit").click(function () {
    location='/hudong.html'
})

</script>
</body>
</html>
